<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>开药信息</title>
    <link href="<%=basePath%>/css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=basePath%>/js/jquery.min.js"></script>

    <script type="text/javascript">

        function deletes(id,yzid){
            window.location.href="kylist.html";
        }
        function ky(){
<%--// 	var yzid = '<%=yzid%>';--%>
            var roid = $("#roid").val();
            alert("roid="+roid);
            window.location.href="<%=basePath%>kyAdd?roid=" + roid;
        }
        $(function(){
            $('tbody tr:odd').addClass("trLight");

            $(".select-all").click(function(){
                if($(this).attr("checked")){
                    $(".checkBox input[type=checkbox]").each(function(){
                        $(this).attr("checked", true);
                    });
                }else{
                    $(".checkBox input[type=checkbox]").each(function(){
                        $(this).attr("checked", false);
                    });
                }
            });
        });
    </script>
    <script type="text/javascript">
        function back(){
            window.location.href="<%=basePath%>zdListController";
        }

    </script>
    <style type="text/css">
        body {
            background:#FFF
        }
    </style>
</head>
<body>
<div id="contentWrap">
    <!--表格控件 -->
    <input type="hidden" name="roid" id="roid" value="${roid}"/>
    <form action="<%=basePath%>doc/kyAdd.jsp" method="post" name="form1">
    <div id="widget table-widget">
        <div class="pageTitle">医生开药列表</div>
        <div class="pageColumn">
            <table>
                <thead>
                <th width="">挂号号</th>
                <th width="">药品ID</th>
                <th width="">药品名称</th>
                <th width="">数量</th>
                <th width="">描述</th>
                <th width="10%">操作</th>
                </thead>
                <tbody>
                <c:forEach items="${kyList}" var="ky">
                    <tr>
                        <td>${ky.roid}</td>
                        <td>${ky.drugsid}</td>
                        <td>${ky.drugname}</td>
                        <td>${ky.num}</td>
                        <td>${ky.descs}</td>
                        <td><a onclick="deletes(id)"><img src="<%=basePath%>images/icon/del.png" width="16" height="16" /></a></td>
                    </tr>
                </c:forEach>
                <tr><td colspan="6"><input type="button" onclick="ky()" value="新增药品"/>&nbsp;<input type="button" value="返回" onclick="back()"/> </td></tr>
                </tbody>
            </table>
        </div>
    </div><!-- #widget -->
    </form>
</div>
</body>
</html>
